import http from '@/utils/request.js'

//请求首页数据
export const getData=()=>{
    //返回promise对象
    return http.get('/home/getData')
}

//请求用户数据
export const getUserData=()=>{
    //返回promise对象
    return http.get('/user/getData')
}


//添加新的用户数据
export const addUser=(user)=>{
    //返回promise对象
    return http.post('/user/add',user)
}

//删除选中的用户数据
export const deleteUser=(user)=>{
    //返回promise对象
    return http.post('/user/delete',user)
}

//编辑选中的用户数据
export const editUser=(user)=>{
    console.log('editUser',user)
    //返回promise对象
    return http.post('/user/edit',user)
}

//登录
export const getMenu=(loginForm)=>{
    console.log('loginForm',loginForm)
    //返回promise对象
    return http.post('/permission/getMenu',loginForm)
}

//退出登录
export const logout=()=>{
    //返回promise对象
    return http.post('/permission/logout')
}
